const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')

//创建实例插件对象
const htmlPlugin = new HtmlWebpackPlugin({
  template: path.join(__dirname, './src/index.html'), // __dirname （双下划线）当前目录
  filename: 'index.html'// 生成内存中
})
//向外打包配置对象,webpack基于node构建
module.exports = {
  mode: 'development', // development','production'
  // webpack.4.x中默认src路径
  // 插件安装依赖
  plugins: [
    htmlPlugin
  ]
}
